package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.SafetyMapper;
import com.youlai.boot.system.model.QB.Safety;
import com.youlai.boot.system.service.SafetyService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class SafetyServiceImpl extends ServiceImpl<SafetyMapper, Safety> implements SafetyService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
        private  SafetyMapper safetyMapper;
    @Override
    public boolean saveSafety(Safety safety) {

        safety.setAddtime(LocalDateTime.now());
        return save(safety);
    }

    @Override
    public List<Safety> getAllSafety() {
        return safetyMapper.selectList(null);
    }

    @Override
    public boolean deleteSafetyById(Integer id) {
        return baseMapper.deleteById(id) >0;
    }
}
